<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>南昌大学码</title>
    <style>
        html,
        body,
        div,
        div,
        ul,
        li,
        h1,
        h2,
        h3,
        p,
        img {
            margin: 0;
            padding: 0;
            box-sizing: border-box;
        }

        body {
            background-color: #4873c1;
            padding: 16px;
        }

        li {
            list-style: none;
        }

        li>span:first-of-type {
            display: inline-block;
            margin-right: 16px;
        }

        .icon {
            width: 24px;
            height: 24px;
            transform: translateY(0px);
        }

        .top,
        .title,
        .main,
        .detail {
            color: #fff;
        }

        .top {
            display: flex;
        }

        .top>a{
            margin-right: 16px;
        }

        .top>img:last-of-type {
            margin-left: auto;
        }

        .title {
            text-align: center;
        }

        .title>div {
            margin: 10px;
        }

        .container {
            background-color: #fff;
            padding: 16px;
            border-radius: 10px;
        }

        .main {
            font-size: 14px;
            position: relative;
            overflow: hidden;
        }
        .main::after,.main::before{
            content: ' ';
            width: 120vw;
            height: 120vw;
            position: absolute;
            z-index: 100;
            top: 70%;
            left: -10%;
            border-radius: 30%;
            background-color: #fff;
        }
        @keyframes myRotate1 {
            from{
                transform: rotate(0deg);
            }
            to{
                transform: rotate(360deg);
            }
        }
        @keyframes myRotate2 {
            from{
                transform: rotate(40deg);
            }
            to{
                transform: rotate(400deg);
            }
        }
        .main::after{
            opacity: 0.1;
            animation: myRotate1 linear 5s infinite;

        }
        .main::before{
            opacity: 0.3;
            animation: myRotate2 linear 5s infinite;

        }

        .avator {
            position: absolute;
            top: 20px;
            right: 20px;
            width: 24vw;
            height: 24vw;
        }

        .main li {
            margin: 24px 0;
        }
        .main li:first-of-type{
            margin-top: 0;
        }
        .main li:last-of-type{
            margin-bottom: 0;
        }

        .main,
        .detail {
            background-color: #2665f2;
            border-radius: 10px;
            padding: 16px;
            margin-bottom: 16px;
        }
        .detail{
            display: flex;
        }
        .detail>span{
            display:inline-block;
            margin-right: auto;
        }
        .areaBox,
        .tip {
            background-color: #f4f7fc;
            border-radius: 10px;
            /* padding: 16px; */
        }

        .areaBox {
            margin-bottom: 10px;
            text-align: center;
        }

        .areaBox>.area {
            padding: 16px 0;
            border-bottom: 1px solid #fff;
            display: flex;
        }

        .areaBox>.area>span {
            flex: 1;
            width: 25%;

        }

        /* .qrBox>.qr {
            width: 64%;
        }

        .qrBox {
            margin: 16px auto 4px;
        } */

        /* .renew {
            color: #8f9fcd;
        } */

        /* .tip {
            color: #f4b884;
        } */
        /* .renewImg{
            width: 16px;
            height: 16px;
            transform: translateY(3px);
        } */
        #time {
            /* font-family: Arial, Helvetica, sans-serif; */
            font-size: 46px;
            padding: 40px;
            font-weight: 500;
            /* margin-bottom: 10px; */
            border-bottom: 10px solid #fff;
        }
    </style>
</head>

<body>
    <div class="top">
        <a href="./setting.html"><img class="icon" src="./icons/错.png" alt=""></a>
        <span>电子ID</span>
        <img class="icon" src="./icons/44_点点点.png" alt="">
    </div>
    <div class="title">
        <div class="title__item">南昌大学电子ID</div>
    </div>
    <div class="container">
        <div class="main">
            <ul>
                <li>
                    <span>姓名</span>
                    <span id="name">罗帆</span>
                </li>
                <li>
                    <span>性别</span>
                    <span id="sex">男</span>
                </li>
                <li>
                    <span>学号</span>
                    <span>419100220070</span>
                </li>
                <li>
                    <span>手机号</span>
                    <span>13576815351</span>
                </li>
                <li>
                    <span>身份证号</span>
                    <span>360825********2410</span>
                </li>
                <li>
                    <span>班级</span>
                    <span>数学与计算机学院研究生</span>
                </li>
            </ul>
            <img id="avator" class="avator" src="./icons/avator.jpg" alt="">
        </div>
        <!-- <div class="detail">
            <span>昌通码(获取成功)</span>
            <span>结果仅供参考</span>
            <img class="icon renewImg" src="./icons/刷新_白.png" alt="">

        </div> -->
        <div class="areaBox">
            <div class="title__item" id="time">22:31:45</div>

            <div class="area">
                <span>前湖北</span>
                <span>前湖南</span>
                <span>青山湖</span>
                <span>东湖</span>
            </div>
            <!-- <div class="qrBox">
                <img class="qr" src="./icons/qr.jpg" alt="">
            </div>
            <div>
                <img class="icon renewImg" src="./icons/刷新_黑.png" alt="">
                <span>二维码（</span><span id="second">49</span><span>s）</span>
                <span class="renew">刷新</span>
            </div> -->

        </div>
        <!-- <div class="tip">
            红码不能代表您的健康情况，仅说明按照相关规定暂时不能入校
        </div> -->
    </div>
    <script>
        const $ = (str) => {
            return document.querySelector(str)
        }
        const oTime = $('#time')
        // const oSecond = $('#second')
        const addZero = (num) => {
            return num < 10 ? `0${num}` : num
        }
        const formatTime = (connect) => {
            const date = new Date()
            let h = addZero(date.getHours())
            let m = addZero(date.getMinutes())
            let s = addZero(date.getSeconds())
            return `${h}${connect}${m}${connect}${s}`
        }

        let time = ''
        let s = 49
        // console.log(oTime)
        time = formatTime(':')
        oTime.innerText = time
        setInterval(() => {
            s > 0 ? s-- : s = 60
            time = formatTime(':')
            // oSecond.innerText = s
            oTime.innerText = time
        }, 1000)

        $('#name').innerText = localStorage.name || '罗帆'
        $('#sex').innerText = localStorage.sex || '男'
        $('#avator').src = localStorage.avator || './icons/avator.jpg'
        // console.log(localStorage.avator)
    </script>
</body>

</html>